<?php 
define('ACC', true);
require('../include/init.php');

$data=$_POST;
$up=new UserModel();
if (empty($data)){
	include(ROOT.'view/front/login.html');
	}
if($up->logIn($data['user_name'],$data['pwd'])){
	$msg='登陆成功';
	
 	setcookie('user_name',$data['user_name']);	
 	setcookie('ccode',$up->cCode($data['user_name']));
 	header("Location:index.php");
}else{
	$msg='用户名不存在或密码错误';
	include(ROOT.'view/front/error.html');
}


?>